package demo3;

import java.util.ArrayList;

public class char1401 {
    public static void main(String[] args) {
        //定义一个集合，添加一些学生对象，并进行遍历
        //学生类的属性为：姓名、年龄
        ArrayList<char14>student=new ArrayList<>();
       char14 c1=new char14("张三",12);
       char14 c2=new char14("李四",15);
       student.add(c1);
       student.add(c2);
        for (int i = 0; i < student.size(); i++) {
            char14 c = student.get(i);
            System.out.println(c.getName()+" "+c.getAge());
        }
    }
}
